Skip to content

CSP's source expression 'self' and websockets #5052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Malvoz opened this issue Aug 22, 2019 · 2 comments
Open

CSP's source expression 'self' and websockets #5052

Malvoz opened this issue Aug 22, 2019 · 2 comments

Comments

@Malvoz
Copy link
Contributor

Malvoz commented Aug 22, 2019

There was a CSP spec change to clarify/define that default-src and connect-src with the keyword 'self' should match ws(s):// websocket schemas, i.e:
Content-Security-Policy: default-src 'self' for https://example.com must not block connections to wss://example.com.

However, this wasn't implemented until Sep 17, 2018 in chromium/issues/detail?id=815142#c9 which according to the Chrome version history means that before v70 you must explicitly add your websocket URLs to either connect-src or default-src, e.g:
Content-Security-Policy: default-src 'self'; connect-src 'self' wss://example.com

This issues is a pretty big deal, so there should be a note. It may also be that Safari (w3c/webappsec-csp#7 (comment)), Edge (w3c/webappsec-csp#7 (comment)) and perhaps other browsers still haven't implemented this.

@Malvoz Malvoz changed the title [Support data question/correction] CSP 3's directive keyword 'self'` and websockets CSP 3's directive keyword 'self'` and websockets Aug 23, 2019
@Malvoz Malvoz changed the title CSP 3's directive keyword 'self'` and websockets CSP's directive keyword 'self'` and websockets Aug 23, 2019
@Malvoz Malvoz changed the title CSP's directive keyword 'self'` and websockets CSP's source expression 'self' and websockets Oct 20, 2019
@mkurz
Copy link
Contributor

mkurz commented Apr 1, 2022

There is finally work going on to get this fixed in Safari: https://bugs.webkit.org/show_bug.cgi?id=235873 (before it was https://bugs.webkit.org/show_bug.cgi?id=201591, which was marked as duplicate)

@mkurz
Copy link
Contributor

mkurz commented Apr 4, 2022

https://bugs.webkit.org/show_bug.cgi?id=235873 is now resolved, so this should be fixed in the next Safari release 16 (maybe even 15.5 or 15.6 if those will happen)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants